#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/17 8:47
# @Author: 张涛
# @Email: xxx@gmail.com
# @File：chanpin_rw_page.py


"""
任务界面
"""


from selenium.webdriver.common.by import By
from pages.base_page import BasePage


class DailyRecord(BasePage):
    rwtj_locator = (By.CSS_SELECTOR,'#tab4 > div > div.pull-right > a') #任务添加
    rwzt_locator = (By.XPATH,'/html/body/div[11]/div[2]/form/table/tbody/tr[2]/td[2]/input')  #任务主题
    rwxgr_locator = (By.XPATH,'/html/body/div[11]/div[2]/form/table/tbody/tr[4]/td[2]/input[2]') #任务相关人
    rwxgrxz_locator = (By.XPATH,'/html/body/div[15]/div[2]/form/div/span[1]/input') #选择任务相关人
    rwxgqd_locator = (By.XPATH,'/html/body/div[15]/div[3]/div/button[1]') #任务相关确定
    rwms_locator = (By.XPATH,'/html/body/div[11]/div[2]/form/table/tbody/tr[7]/td[2]/textarea') #任务描述
    rwbc_locator = (By.XPATH,'/html/body/div[11]/div[2]/form/table/tfoot/tr/td[2]/input[1]') #保存任务
    rwxxts_locator = (By.XPATH,'/html/body/div[5]/div/div[2]/div[1]/div[2]/div') #任务提示内容



    def rwtj_element(self):
        '''点击任务添加'''
        self.driver.find_element(*self.rwtj_locator).click()

    def rwzt_element(self,rwzt_a):
        '''输入任务主题'''
        self.driver.find_element(*self.rwzt_locator).send_keys(rwzt_a)

    def rwxgr_element(self):
        '''点击任务相关人'''
        self.driver.find_element(*self.rwxgr_locator).click()

    def rwxgrxz_element(self):
        '''选择任务相关人'''
        self.driver.find_element(*self.rwxgrxz_locator).click()

    def rwxgqd_element(self):
        '''点击确定任务相关'''
        self.driver.find_element(*self.rwxgqd_locator).click()

    def rwms_element(self,rwms_a):
        '''输入任务描述'''
        self.driver.find_element(*self.rwms_locator).send_keys(rwms_a)

    def rwbc_element(self):
        '''点击任务保存'''
        self.driver.find_element(*self.rwbc_locator).click()

    def rwxxts_element(self):
        rwxxts = self.driver.find_element(*self.rwxxts_locator).text
        return rwxxts